<?php
/**
 * @package Hello_Dolly
 * @version 1.5.1
 */
/*
Plugin Name: Disater Relief
Plugin URI: 
Description: 
Author: Team Goldenrod
Version: 1.5.1
Author URI: 
*/

require_once "admin_pages.php";
require_once "db_init.php";
require_once "db.php";
require_once "ajax_functions.php";

add_action('admin_menu', 'modify_admin_menu');
register_activation_hook(__FILE__, 'db_init');
add_action('init', 'init_libraries');

// Ajax handler functions
add_action('wp_ajax_event_add', 'event_add');
add_action('wp_ajax_event_update', 'event_update');
add_action('wp_ajax_event_delete', 'event_delete');
add_action('wp_ajax_event_list', 'event_list');
add_action('wp_ajax_get_event_add_area', 'get_event_add_area');
add_action('wp_ajax_get_event_edit_area', 'get_event_edit_area');

function modify_admin_menu()
{
    add_menu_page('Disaster Event', 'Disasters', 'manage_options', 'disaster_event', 'event_admin_page');
    //add_submenu_page( 'disaster_event', 'Disaster Event', 'Add New..', 'manage_options', 'disaster_manage', 'sub_disaster');
}

function init_libraries()
{
    //$theme_url = plugins_url() . '/disaster_plugin/css/ui-lightness/jquery-ui-1.8.10.custom.css'
    $plugin_path = plugins_url() . '/disaster_plugin/';
    $theme_url = $plugin_path . 'css/custom-theme/jquery-ui-1.8.10.custom.css';
    $style_url = $plugin_path . 'css/style01.css';
    wp_register_style('jquery-ui-style', $theme_url);
    wp_enqueue_style( 'jquery-ui-style');
    wp_register_style('disaster-style', $style_url);
    wp_enqueue_style( 'disaster-style');

    wp_enqueue_script('jquery');
    wp_deregister_script( 'jquery-ui-core' );
    wp_register_script('jquery-ui-core',
              plugins_url() . '/disaster_plugin/js/jquery-ui-1.8.10.custom.min.js',
              'jquery');
    wp_enqueue_script('jquery-ui-core');
    $key = 'ABQIAAAA_SDU-gJUGIwRunz3Ff44qhRrL6TGoZP9Qvf4WE3hkBTlQd8FNBQl8zBi4BBnpuR3kIahU95igLTNLw';
    wp_register_script('google-maps-api', 'http://maps.google.com/maps?file=api&amp;v=2&amp;key=' . $key);
    wp_enqueue_script('google-maps-api');
    wp_register_script('gMap',
              plugins_url() . '/disaster_plugin/js/jquery.gmap-1.1.0.modified.js',
              'jquery');
    wp_enqueue_script('gMap');
}


?>
